Pike ScriptRunner

[ Start > PikeApps > Pike ScriptRunner ] [ Edit this Page | Viewing Version 1 ]


Pike ScriptRunner allows you to run Pike scripts under non-pike based web servers. Pike ScriptRunner is a FastCGI application that will (hopefully) run under pretty much any web server that supports FastCGI.

Because ScriptRunner uses FastCGI, its performance should be close to embedded language solutions like mod_perl, but with a lot less worries about security and overflows. With ScriptRunner you can introduce all of your friends to Pike without forcing them to suffer bad performance or the (more likely) attachment to Apache. In addition, ScriptRunner does a lot of the unpleasant work of parsing incoming requests, allowing you to get right to the task of writing your code.

Right now, it's pretty early on in its development, so there are a lot of niceties present in Roxen or Caudium that aren't available, and it's not terribly well tested, so it could have some nasty bugs. Enough raw functionality is available to be highly useful; hopefully there will be interest in improving things in this area. ScriptRunner contains code written by others over the years; this is really more of a gathering of snippets into something more readily useful to others.

Requirements:

- Pike 7.6+ (available from http://pike.ida.liu.se)

  • libfastcgi (available from http://www.fastcgi.com)
  • Public.Web.FastCGI (available from http://www.siriushosting.com/pike/fastcgi.html)

    Features:

  • Multi-threaded request handling
  • Persistent interpreter
  • Compiled object caching
  • Incoming requests are parsed and passed to you in a request id object.
  • Handles FCGI processing for you. Just return a string or control mapping from your parse() method.

    Download:

    - http://hww3.riverweb.com/dist/scriptrunner/scriptrunner-0.1.tar.gz

    Installation:

    Apache users: see the file INSTALL.Apache in the source distribution for information on configuring Apache support for FastCGI.

    Make sure that you have satisified the prerequisites before continuing.

    Install and configure FastCGI support for your webserver so that *.fcgi files are treated as FastCGI applications.

    Simply copy the scriptrunner files to a FastCGI enabled web server (it's

recommended that you just copy the whole ScriptRunner directory.

Edit the scriptrunner application to specify an optional log file (recommended).

Add a redirect to convert all requests to (*.pike) to /path/to/scriptrunner.fcgi($1) (actual syntax will vary based on the redirector you're using.

For example, if I've installed ScriptRunner so that the ScriptRunner.fcgi is called by the following request:

www.mysite.com/path/to/ScriptRunner.fcgi

and I put a pike script in /some/other/path.pike on my website, I need my redirect to internally change

www.mysite.com/some/other/path.pike

to

www.mysite.com/path/to/ScriptRunner.fcgi/some/other/path.pike

This is a common technique used by PHP and other languages. Alternately, you could use mod_actions to do the same thing:

AddHandler scriptrunner-pike-script .pike Action scriptrunner-pike-script /path/to/ScriptRunner.fcgi

In the long run, this may be a simpler option.

Some example scripts (they all start with test) are included to give you a head start.

Support

Pike ScriptRunner is free software made available under the GPL/LGPL/MPL licenses. We're just getting started, so we're not totally organized yet. For the time being, send email to the Pike mailing list: pike at roxen dot com or to the author: bill at gotpike dot org.


Powered by PikeWiki2

 
gotpike.org | Copyright © 2004 - 2009 | Pike is a trademark of Department of Computer and Information Science, Linköping University